home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-websites-
/
sasg
/
dfa
/
rexx
/
dfatowrite.lha
/
dfatowrite.dfa
Wrap
Text File
|
1996-06-16
|
3KB
|
79 lines
/*****************************************************************************
Export DFA to Gold Disk's TransWrite Mailmerge File
Based on "export_bt_ii.dfa (c) Dirk Federlein 1994
** Version: 24/1/95 ** (c) Donald Dalley 1995
Purpose: Exports selected addresses to a mailmerge
file for TransWrite.
Exports a file in the following format:
First Name
Company Name * optional *
Street
City State
Country
ZIP
>
Feel free to change/re-order them. Also, if you don't enter commas into DFA's
database, you can change this script and add them to the export file.
*****************************************************************************/
/* Turn on error checking by uncommenting the following TRACE command. */
OPTIONS RESULTS /* Lets REXX accept RESULT values */
/* TRACE RESULTS */ /* Turn on to check for errors */
exportfile = 't:dfa_TW.export' /* assign path:<filename> for WRITE*/
IF ~SHOW(PORTS, DFA) THEN EXIT 10 /* _Find port DFA, if not, stop. */
/* _Don't run DFA more than once! */
IF OPEN('exf',exportfile,'WRITE') THEN DO /* open exportfile in RAM: */
ADDRESS 'DFA' /* Get DFA's attentio */
FIRST STEM ADR. /* Find first record */
IF ADR.ADDRESS.24 = 0 THEN /* if first record is not selected */
NEXTSEL STEM ADR. /* then find first selected record */
/* ---------- This LOOP picks items written to DFA's export file ---------- */
DO WHILE RC = 0 /* If there are no errors, write */
CALL WRITECH('exf',ADR.ADDRESS.1) /* `first' name |WriteCh adds no| */
CALL WRITECH('exf',' ') /* pad space |carriage return| */
CALL WRITELN('exf',ADR.ADDRESS.2) /* `last' name |WriteLn adds cr| */
/*CALL WRITELN('exf',ADR.ADDRESS.3)*/ /* uncomment co name if needed */
CALL WRITELN('exf',ADR.ADDRESS.4) /* `street' */
CALL WRITECH('exf',ADR.ADDRESS.6) /* `city' */
CALL WRITECH('exf',' ') /* pad space */
CALL WRITECH('exf',ADR.ADDRESS.7) /* `state' */
CALL WRITELN('exf',ADR.ADDRESS.8) /* `country' */
CALL WRITELN('exf',ADR.ADDRESS.5) /* `postal code' */
CALL WRITELN('exf','>') /* adds merge record seperator ">" */
NEXTSEL STEM ADR. /* go to next selected record */
END /* DO */
CALL CLOSE ('exf') /* close export file */
END /* DO */
/* Give user instructions here */
SAY "" /* write blank line to screen */
SAY "The mailmerge file is in RAM:t."
SAY "Merge it from there, or SAVE it."
SAY ""
EXIT 0